set maxRequestsPerHost of okhttp to support slow response requests and high TPS#708
Conversation
mukundansundar
left a comment
There was a problem hiding this comment.
@skyao Keep in mind that in future we will be moving away from OkHttp and move to native Java Client. But I believe these parameters will still add value there.
OK. Before we changed to native java client, we still need OkHttp. The fix for default maxRequestPerHost is very important. |
|
@skyao Please, sign off the commits. This is a new requirement in our repos since the CNCF donation. |
…d high TPS Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #708 +/- ##
============================================
+ Coverage 80.66% 80.72% +0.06%
Complexity 993 993
============================================
Files 81 81
Lines 3010 3020 +10
Branches 340 340
============================================
+ Hits 2428 2438 +10
Misses 416 416
Partials 166 166
Continue to review full report at Codecov.
|
…d high TPS (dapr#708) * set maxRequestsPerHost of okjava to support slow response requests and high TPS Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * fix typo in comments Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * update comments Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * update javadoc Signed-off-by: Sky Ao <aoxiaojian@gmail.com> Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
…d high TPS (dapr#708) * set maxRequestsPerHost of okjava to support slow response requests and high TPS Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * fix typo in comments Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * update comments Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * update javadoc Signed-off-by: Sky Ao <aoxiaojian@gmail.com> Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
…d high TPS (dapr#708) * set maxRequestsPerHost of okjava to support slow response requests and high TPS Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * fix typo in comments Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * update comments Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * update javadoc Signed-off-by: Sky Ao <aoxiaojian@gmail.com> Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
…d high TPS (dapr#708) * set maxRequestsPerHost of okjava to support slow response requests and high TPS Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * fix typo in comments Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * update comments Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * update javadoc Signed-off-by: Sky Ao <aoxiaojian@gmail.com> Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
…d high TPS (dapr#708) * set maxRequestsPerHost of okjava to support slow response requests and high TPS Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * fix typo in comments Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * update comments Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * update javadoc Signed-off-by: Sky Ao <aoxiaojian@gmail.com> Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
…d high TPS (dapr#708) * set maxRequestsPerHost of okjava to support slow response requests and high TPS Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * fix typo in comments Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * update comments Signed-off-by: Sky Ao <aoxiaojian@gmail.com> * update javadoc Signed-off-by: Sky Ao <aoxiaojian@gmail.com> Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Description
In dapr java sdk, there are some default settings in okhttp which we don't set and use the default value:
The default value 5 of maxRequestsPerHost is totally unacceptable, it will lead to very serious problems of very low throughput as discribed in issue #709.
And the default value 64 of maxRequests is not enough for the user case of high TPS. For example, if the response time is 100 ms, 64 connections leads to at most 640 TPS.
Issue reference
This PR is to fix this issue.
#709
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: